class Solution:
    def wordBreak(self, s: str, wordDict: List[str]) -> List[str]:
        vocab="".join(wordDict)
        for c in s:
            if c not in vocab:
                return []
        results=[]
        def findword(start,output):
            if start==len(s):
                results.append(output[1:])
            for i in wordDict:
                if i==s[start:start+len(i)]:
                    findword(start+len(i),output+" "+i)
        findword(0,"")
        return results